package com.forcedotcom.explorer
{
	import com.salesforce.objects.LoginRequest;
	import com.salesforce.results.LoginResult;

	public class Credential
	{
		private var username:String;
		private var password:String;
		private var token:String;
		
		public var loginReq:LoginRequest = new LoginRequest();
		public var loginRes:LoginResult;
		
		public function get serverUrl():String {
			return loginReq.server_url;
		}
		public function set serverUrl(url:String):void {
			loginReq.server_url = url;
		}
		public function Credential(un:String, pw:String, tk:String=null, surl:String = null)
		{
			username = un;
			password = pw;
			token = tk;
			loginReq.username = username;
			loginReq.password = password;
			if (token != null) { loginReq.password += token; }
			if (surl != null) { serverUrl = surl; }
		}
	}
}